# -*- coding: utf-8 -*-

# -------------------------------
# Author    : linlingwei
# Email     : 951035650@qq.com
# File Name : t8.py
# Date      : 2020/11/25 
# -------------------------------
__author__ = "linlingwei"
import maya.cmds as mc
import pymel.core as pm

org_bls = pm.PyNode("Facial_corrective_bls")
new_bls = pm.PyNode("blendShape60")
weightIndexList = org_bls.weightIndexList()
getBaseObjects = new_bls.getBaseObjects()[0]
for i in weightIndexList:
    name = org_bls.w[i].getAlias()
    dup = pm.duplicate("head_org_geo_new",name=name+"_new")[0]
    # new_bls.addTarget(getBaseObjects,i,dup,0)
    mc.blendShape(new_bls,target=[getBaseObjects.name(),i,dup.name(),0])
    new_bls.w[i].setAlias(name)
for i in weightIndexList:
    connect = org_bls.w[i].inputs(p=1)
    if connect:
        connect[0] >> new_bls.w[i]

if __name__ == '__main__':
    pass
